home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 08 - 1992 / 08.03 Jul 92 / Matrix Parser / SetValues < prev    next >
Encoding:
Text File  |  1992-12-24  |  1.1 KB  |  59 lines  |  [TEXT/PJMM]

  1. unit SetValues;
  2.  
  3. interface
  4.  
  5.     uses
  6.         Globals;
  7.  
  8.     procedure setvalues (var nodetable: hdlarrayhdlnoderecord; var numnodes, numvariables: longint);
  9.  
  10.  
  11. implementation
  12.  
  13.     procedure setvalues;
  14.  
  15.         var
  16.             i, j, l, m: longint;
  17.  
  18.  
  19.     begin
  20.  
  21.         i := 1;
  22.         while i <= numnodes do
  23.             begin
  24.                 l := numnodes + 1 - i;
  25.                 j := 1;
  26.                 while j <= numvariables do
  27.                     begin
  28.                         m := numvariables + 1 - j;
  29.                         if (nodetable^^[l]^^.lop.index = strvar^^[m]^^) then
  30.                             begin
  31.                                 nodetable^^[l]^^.loptype := 'matrix';
  32.                                 nodetable^^[l]^^.lop.index := stringof(m);
  33.                             end;
  34.                         if (nodetable^^[l]^^.rop.index = strvar^^[m]^^) then
  35.                             begin
  36.                                 nodetable^^[l]^^.roptype := 'matrix';
  37.                                 nodetable^^[l]^^.rop.index := stringof(m);
  38.                             end;
  39.                         j := j + 1;
  40.                     end;
  41.                 i := i + 1;
  42.             end;
  43.  
  44.  
  45.         i := 1;
  46.         while i <= numnodes do
  47.             begin
  48.                 l := numnodes + 1 - i;
  49.                 if nodetable^^[l]^^.lop.index = 'pi' then
  50.                     nodetable^^[l]^^.lop.index := stringof(pivalue : 30 : 20);
  51.                 if nodetable^^[l]^^.rop.index = 'pi' then
  52.                     nodetable^^[l]^^.rop.index := stringof(pivalue : 30 : 20);
  53.                 i := i + 1;
  54.             end;
  55.  
  56.     end;
  57.  
  58.  
  59. end.